namespace OpenVision.Data.Migrations
{
    using OpenVision.Models;
    using System.Data.Entity.Migrations;

    public sealed class Configuration : DbMigrationsConfiguration<OpenVisionContext>
    {
        public Configuration()
        {
            this.AutomaticMigrationsEnabled = true;
            this.AutomaticMigrationDataLossAllowed = true;
        }

        protected override void Seed(OpenVisionContext context)
        {
            var user = new User()
            {
                Nickname = "User #1",
                Password = "18f50456fe3f3ffd7b4360786fc26489a4db8a16",
                Email = "user@mail",
            };
            
            context.Users.AddOrUpdate(x => x.Nickname, user);
        }
    }
}